package com.demo.action;



import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.demo.formbean.UserForm;
import com.demo.service.LoginService;
import com.demo.serviceImpl.LoginServiceImpl;
import com.demo.vo.UserVo;

import struts.action.Action;
import struts.form.ActionForm;


public class LoginAction implements Action{

	public String execute(HttpServletRequest request,HttpServletResponse response,ActionForm actionform) {
		LoginService loginService=new LoginServiceImpl();
		UserForm userform=(UserForm)actionform;
		UserVo user=loginService.loginValidate(userform.getUsername(), userform.getPassword());
		request.setAttribute("User", user);
		return user.getMsg();
	}

}
